<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>会员信息管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
#@css?("layui")
</head>
<body>
	<fieldset class="layui-elem-field layui-field-title">
		<legend>用户管理</legend>
	</fieldset>
	<fieldset class="layui-elem-field site-demo-button">
		<div class="layui-btn-group">
			<a class="layui-btn layui-btn-normal" href="#(ctx)/admin/user/add">增加</a>
			<button class="layui-btn layui-btn-normal" id="delAll">删除所选</button>
		</div>
	</fieldset>
	<table class="layui-table" lay-skin="nob">
		<colgroup>
			<col width="50">
			<col width="150">
			<col width="150">
			<col width="150">
			<col width="200">
			<col>
		</colgroup>
		<thead>
			<tr>
				<th>选取</th>
				<th>编号</th>
				<th>登录帐号</th>
				<th>姓名</th>
				<th>联系方式</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			#for(t:tableList)
			<tr>
				<td><input type="checkbox" id="all" value="#(t.id)" /></td>
				<td>#(t.id)</td>
				<td>#(t.account)</td>
				<td>#(t.nick)</td>
				<td>#(t.phonenum)</td>
				<td><div class="layui-btn-group">
						<a class="layui-btn layui-btn-normal"
							href="#(ctx)/admin/user/edit?id=#(t.id)">编辑</a> <a
							class="layui-btn layui-btn-normal"
							href="#(ctx)/admin/user/delete?id=#(t.id)">删除</a>
					</div></td>
			</tr>
			#end
		</tbody>
	</table>

	#@js?("layui")
	<script>
		layui.use([ "jquery", "layer" ], function() {
			var $ = layui.jquery, layer = layui.layer;
			$("#delAll").bind(
					"click",
					function() {
						var chk_value = checkboxSelected();
						if (chk_value.length == 0) {
							layer.msg("您未选择任何数据!");
							return;
						}
						window.location.href = "#(ctx)/admin/user/delete?id="
								+ chk_value;
					});
			var checkboxSelected = function checkboxSelected() { //jquery获取复选框值 
				var chk_value = [];
				$('input[id="all"]:checked').each(function() {
					chk_value.push($(this).val());
				});
				return chk_value.join(",");
			}
		});
	</script>
</body>
</html>